/**
 * This class is used for the player to get goods.
 * 
 * @author Hung Lac
 * @version 1.0
 */
public class MarketPlace implements java.io.Serializable{
	
	/**
	 * Array of the model used for the good in the marketplace
	 */
	private final GoodsModel[] goodsModel;
	
	/**
	 * Array of the information related to the goods
	 */
	private final GoodsInfo goodsInfo;
	
	/**
	 * Array of goods in the marketplace
	 */
	private final Goods[] goods;
	
	/**
	 * This method creates new goods and a new goods model 
	 * and saves them and their prices in array
	 *
	 * @param planet - what planet the market place is on
	 */
	public MarketPlace(Planet planet){
		goodsInfo = new GoodsInfo(); // $codepro.audit.disable staticInstantiation
		// the goodsInfo object is needed to create new goodsModel objects  
		
		goodsModel = new GoodsModel[GoodsInfo.BasePrice.length];
		goods= new Goods[GoodsInfo.BasePrice.length];
		for(int i=0; i < GoodsInfo.BasePrice.length; i++){
			goodsModel[i]= new GoodsModel(goodsInfo, i);
			goods[i]=new Goods(goodsModel[i], planet);
		}
	}
	
	/**
	 * Method that gets an array of goods and prices
	 *
	 * @return The goods and their prices
	 */
	public GoodsModel[] getGood(){
		return goodsModel;
	}
	
	/**
	 * Method for getting the goods
	 *
	 * @return The goods
	 */
	public Goods[] getGoodsArray(){
		return goods;
	}
	
	/**
	 * Method that gets information about the marketplace
	 * 
	 * @return No information is needed to return
	 */
	public String toString(){
		return "";
	}
}
